home *** CD-ROM | disk | FTP | other *** search
- Path: sdd.hp.com!inn
- From: Jeff Grimmett <jgrimm@sdd.hp.com>
- Newsgroups: comp.sys.amiga.programmer
- Subject: Re: More
- Date: 21 Jan 1996 18:21:19 GMT
- Organization: Hewlett-Packard Company
- Message-ID: <4du06v$7in@news.sdd.hp.com>
- References: <9601201749.AA00046@cliffe.demon.co.uk>
- NNTP-Posting-Host: hpsdv330.sdd.hp.com
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 1.2N (Windows; I; 16bit)
-
- Steven Chapman <steve@cliffe.demon.co.uk> wrote:
-
- > if(!(fh = fopen("T:xx", "w")))
- >Work-1:Steve1.c 41 Warning 225: pointer type mismatch
- > "BPTR" does not match "struct __iobuf *"
-
- Well, beleive your compiler, it's not lying. fopen() returns a FILE
- pointer, ie
-
- FILE *fp;
-
- and what you're asking it to do is return a BPTR. Not gonna work.
-
- I didn't examine your code thoroughly so what you do about this just
- depends on what you're going to do with the file.
-
- If you want to pass that pointer to other AmigaDOS functions that require
- a BPTR, your best option is to can the ANSI file code (fopen()) and go
- directly to AmigaDOS functions like Open() and Close(). THEY operate
- with the BPTR file handle quite well.
-
- On the other hand, if all you're doing is fopen() fwrite() fread()
- fclose() etc, then just change your declaration from BPTR * to FILE *.
-
-
-
-